package com.ziyueyuwen.xiniao.service;

import com.ziyueyuwen.xiniao.bean.page.PageData;
import com.ziyueyuwen.xiniao.bean.product.*;
import com.ziyueyuwen.xiniao.bean.ZyProductInfo;
import com.ziyueyuwen.xiniao.bean.ZyProductStage;
import com.ziyueyuwen.xiniao.bean.select.SelectBean;
import com.ziyueyuwen.xiniao.bean.vo.ZyCourseVO;
import com.ziyueyuwen.xiniao.enums.DataActionEnum;
import com.ziyueyuwen.xiniao.enums.GradeEnum;
import com.ziyueyuwen.xiniao.enums.ProductClassRuleEnum;

import java.util.List;
import java.util.Map;

/**
 * @author wancheng  on 2019/2/21.
 */
public interface ProductService {
    /**
     * 保存
     * @param product
     * @throws Exception
     */
    void saveSelective(ProductSaveAO product) throws Exception;

    /**
     * 修改
     * @param productUpdate
     * @throws Exception
     */
    void updateSelective(ProductSaveAO productUpdate) throws Exception;

    /**
     * ProductSaveAO 转 ZyProductInfo
     * @param productSaveAO
     * @return
     */
    ZyProductInfo getProduct(ProductSaveAO productSaveAO);

    /**
     * ProductSaveAO 获取 ZyProductStage
     * @param productSaveAO
     * @return
     */
    ZyProductStage getStage(ProductSaveAO productSaveAO);

    /**
     *主键获取
     * @param id
     * @return
     */
    ProductVO getProductAndStageByPreKey(Integer id);

    /**
     * 课程名获取
     * @param courseName
     * @return
     */
    List<ZyCourseVO> getCourseInfo(String courseName);

    /**
     * 获取班级
     * @param courseId
     * @param className
     * @param action
     * @param productId
     * @return
     */
    List<SelectBean> getClassInfo(Integer courseId, String className, DataActionEnum action,Integer productId);

    /**
     * 商品的上下架
     * @param productId
     * @param productStatus
     * @throws Exception
     */
    void productUpperOrLowerShelf(Integer productId, Boolean productStatus) throws Exception;

    /**
     * 获取商品的开课时间
     * @return
     */
    List<ZyProductStage> getProductStage();

    /**
     * 后台商品筛选
     * @param query
     * @return
     */
    PageData<ProductListVO> getProductListForPc(ProductListQuery query);

    /**
     * 获取上架商品的年级
     * @return
     */
    List<SelectBean> getProductQueryGrade();

    /**
     * 获取上架商品的日期
     * @param courseId
     * @return
     */
    List<SelectBean> getProductQueryDate(Integer courseId);

    /**
     * 获取上架商品的时间
     * @param courseId
     * @param stageId
     * @param classRule
     * @return
     */
    List<SelectBean> getProductQueryTime(Integer courseId,Integer stageId,ProductClassRuleEnum classRule);

    /**
     * 获取商品的组
     * @param grade
     * @return
     */
    List<ProductStudentGroupVO> getProductGroup(GradeEnum grade);

    /**
     * 获取商品列表
     * @param query
     * @return
     */
    PageData<ProductStudentListVO> getStudentProductList(ProductStudentListQuery query);

    /**
     * 获取商品详情
     * @param productId
     * @param userAccount
     * @return
     */
    ProductStudentListVO  getStudentProductInfoByProductId(Integer productId,String userAccount);

    /**
     * 销售查看在售商品课程信息
     * @param grade
     * @return
     */
    List<SaleCourseVO> productMsgForSale(GradeEnum grade);

    /**
     * 销售查看在售课程详情
     * @param query
     * @return
     */
    Map<String,Object> courseDetailsForSale(SaleCourseDetailsQuery query);

    /**
     * 销售查看课程信息参数详情
     * @param query
     * @return
     */
    List<SaleDateParam> getCourseDetailsParams(SaleCourseDetailsQuery query);

}
